<script type="text/javascript" src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script type="text/javascript" src="ckfinder/ckfinder.js"></script>
<p id='finder'>
	<script type="text/javascript">

		// This is a sample function which is called when a file is selected in CKFinder.
		function showFileInfo( fileUrl, data )
		{
			var msg = 'The selected URL is: <a href="' + fileUrl + '">' + fileUrl + '</a><br /><br />';
			// Display additional information available in the "data" object.
			// For example, the size of a file (in KB) is available in the data["fileSize"] variable.
			if ( fileUrl != data['fileUrl'] )
				msg += '<b>File url:</b> ' + data['fileUrl'] + '<br />';
			msg += '<b>File size:</b> ' + data['fileSize'] + 'KB<br />';
			msg += '<b>Last modifed:</b> ' + data['fileDate'];

			// this = CKFinderAPI object
			this.openMsgDialog( "Selected file", msg );
		}

		// You can use the "CKFinder" class to render CKFinder in a page:
		var finder = new CKFinder();
		// The path for the installation of CKFinder (default = "/ckfinder/").
		finder.basePath = '../../';
		// This is a sample function which is called when a file is selected in CKFinder.
		finder.selectActionFunction = showFileInfo;
		finder.height = '100%';
		finder.width  = '100%';
		finder.create();

		// It can also be done in a single line, calling the "static"
		// create( basePath, width, height, selectActionFunction ) function:
		// CKFinder.create( '../../', null, null, showFileInfo );

		// The "create" function can also accept an object as the only argument.
		// CKFinder.create( { basePath : '../../', selectActionFunction : showFileInfo } );
		
		$(function(){
			setTimeout("hideFooterDemo(0)",'500');
			setTimeout("hideCenterDemo(0)",'500');
		});
		
		function hideFooterDemo(i)
		{
			if(window.frames[0] && $('#sidebar_wrapper div.tool_panel',window.frames[0].document).length>0)
			{
				$('#sidebar_wrapper div.tool_panel',window.frames[0].document).css('display','none');
				$('#folders_view',window.frames[0].document).css('height','100%');
			}
			else 
			{
				if(i<500)
					setTimeout("hideFooterDemo("+(i+1)+")",'500');
			}
		}
		
		function hideCenterDemo(i)
		{
			if(window.frames[0] && $('h4.message_content',window.frames[0].document).length>0)
			{
				$('h4.message_content',window.frames[0].document).css('display','none');
			}
			else 
			{
				if(i<500)
					setTimeout("hideCenterDemo("+(i+1)+")",'500');
			}
		}
	</script>
</p>